Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
After migrating to yarn 3 workspace "Cannot use import statement outside a module" running react-scripts test

I have a repository with yarn 3 workspaces and a CRA front end located in /packages/client

yarn workspace client start successfully launches the development app on port 3000.

The test suite ran correctly before moving the client to the packages folder and setting up the yarn workspace. I have made no changes to the client's package.json.

Running yarn workspace client test gives:

Error: Failed to initialize watch plugin "../../.yarn/__virtual__/jest-watch-typeahead-virtual-2d80f0ed7c/0/cache/jest-watch-typeahead-npm-1.0.0-0c228b0e38-388d518974.zip/node_modules/jest-watch-typeahead/build/file_name_plugin/plugin.js":

  ● Test suite failed to run

    /Users/bob/monorepo/.yarn/__virtual__/jest-watch-typeahead-virtual-2d80f0ed7c/0/cache/jest-watch-typeahead-npm-1.0.0-0c228b0e38-388d518974.zip/node_modules/jest-watch-typeahead/build/file_name_plugin/plugin.js:1

import { Prompt } from 'jest-watcher';
    ^^^^^^

    SyntaxError: Cannot use import statement outside a module

      28077 |     try {
      28078 |       module.isLoading = true;
    > 28079 |       module.load(modulePath);
            |              ^
      28080 |       hasThrown = false;
      28081 |     } finally {
      28082 |       module.isLoading = false;

      at Function.external_module_.Module._load (../../.pnp.cjs:28079:14)
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!